package vn.candyapp.qlct.database.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

public class CategoryList implements Serializable {

	private static final long serialVersionUID = 1L;
	private ArrayList<Category> categoriesList = new ArrayList<Category>();
	
	public ArrayList<Category> getCategoriesList() {
		return categoriesList;
	}
	
	public Category getCategoryAtPosition(int position) {
		if (position < categoriesList.size())
			return categoriesList.get(position);
		return null;
	}
	
	public void setCategoriesList(ArrayList<Category> categoriesList) {
		this.categoriesList = categoriesList;
	}
	
	public List<String> getCatNames() {
		List<String> data = new ArrayList<String>();
		for(Category item : categoriesList) {
			data.add(item.getName());
		}
		return data;
	}
	
	
}
